Skip to content

fix: logs command multi-topic search and SLS field query syntax#151

Merged
rsonghuster merged 3 commits intomasterfrom
fix/logs-multi-topic-and-query-syntax
May 5, 2026
Merged

fix: logs command multi-topic search and SLS field query syntax#151
rsonghuster merged 3 commits intomasterfrom
fix/logs-multi-topic-and-query-syntax

Conversation

@rsonghuster
Copy link
Copy Markdown
Contributor

@rsonghuster rsonghuster commented May 4, 2026

  • Search FCInstanceEvents topic alongside FCLogs when --instance-id is specified
  • Use SLS field-specific query syntax: qualifier: "value", instanceID: "value", requestId: "value"
  • Stop unsetting LATEST qualifier (was preventing LATEST version log searches)
  • Support --request-id and --instance-id filters in realtime (--tail) mode
  • Update docs and help text for the new behavior

Change-Id: Id05f45be1e1597dd89682a2ebab336b68735ca89
Co-developed-by: Claude noreply@anthropic.com

Summary by CodeRabbit

  • New Features

    • s logs now supports multi-topic searching (includes FCInstanceEvents when using --instance-id) and preserves explicit qualifier LATEST.
  • Documentation

    • Expanded s logs docs with examples for --instance-id, --request-id, --qualifier and SLS topic types.
    • Help text for --instance-id updated.
    • Added CLAUDE.md with project overview, workflow, and documentation index.
  • Tests

    • Updated logs test coverage to validate multi-topic filtering, instance-id behavior, and qualifier handling.
  • Chores

    • CI workflows updated to use newer GitHub Action versions; runtime deprecation warnings suppressed.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 4, 2026

Warning

Rate limit exceeded

@rsonghuster has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 51 minutes and 31 seconds before requesting another review.

To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: fa2aa1c4-43b6-4f4f-958e-e280c7f866f8

📥 Commits

Reviewing files that changed from the base of the PR and between 29a1b40 and f634129.

📒 Files selected for processing (2)
  • .github/workflows/ci_node16.yaml
  • .github/workflows/ci_with_docker_linux.yaml
📝 Walkthrough

Walkthrough

Adds computed SLS topicFilter support to the logs subcommand (multi-topic queries including FCInstanceEvents when --instance-id is used), propagates topicFilter through realtime/history flows and SLS query construction, updates tests, help text, and docs; adds CLAUDE.md; and moves a process.noDeprecation assignment in src/index.ts.

Changes

SLS Topic Filter Enhancement

Layer / File(s) Summary
Data Shape
src/subCommands/logs/index.ts
Typings: IGetLogs gains optional topic; IRealtime/IHistory now include topicFilter: string and make requestId/instanceId optional; returned IProps includes functionName? and topicFilter.
Inputs / Computation
src/subCommands/logs/index.ts
getInputs() computes topic/topicFilter from functionName (handles $ qualifier), expands topicFilter to include FCInstanceEvents:/<function> when --instance-id is present, and stops clearing qualifier === 'LATEST'.
Core Query Construction
src/subCommands/logs/index.ts
getSlsQuery(..., topicFilter?) accepts optional topicFilter and conditionally prepends it into the assembled query string; it uses field-specific qualifier syntax and includes instanceID/requestId predicates when provided.
Runtime Flows
src/subCommands/logs/index.ts
realtime(), _realtimeOnce(), and history() destructure and forward topicFilter, requestId, and instanceId into getSlsQuery() and use the resulting query for getLogs.
Request Plumbing
src/subCommands/logs/index.ts
getLogs() removes topic from request params before calling this.slsClient.getLogs(...).
Tests
__tests__/ut/commands/logs_test.ts
Realtime/history/getInputs/getSlsQuery tests updated to assert topicFilter presence, composed or filter when --instance-id provided, qualifier field syntax (qualifier: "LATEST"), topicFilter-only queries, and preserved explicit --qualifier LATEST.
Help & Docs
src/commands-help/logs.ts, docs/technical-documentation.md, docs/architecture.md
Help text for --instance-id updated to mention searching FCInstanceEvents; docs extended with SLS query generation, multi-topic search, topic type descriptions, and example usages (--instance-id, --request-id, --qualifier).

Developer & Miscellaneous

Layer / File(s) Summary
Documentation Addition
CLAUDE.md
New CLAUDE.md added describing project overview, tech stack, npm scripts, directory map, testing instructions/status, architecture pointer, recent features, dev workflow checklist, and docs index.
Build / Runtime Setting
src/index.ts
Moved/placed (process as any).noDeprecation = true; into the module body near the SCHEMA_FILE_PATH import; no exported API changes.
CI Actions Updates
.github/workflows/ci_node16.yaml, .github/workflows/ci_with_docker_linux.yaml
Upgraded GitHub Action versions: actions/checkout@v4, actions/setup-node@v4, and actions/setup-java@v4 with distribution: temurin (keeps java-version: 8) across CI jobs.

Sequence Diagram(s)

sequenceDiagram
    participant CLI as CLI
    participant Logs as Logs subcommand
    participant SLS as SLS API / slsClient
    CLI->>Logs: invoke `s logs` (function, --instance-id, --qualifier, --request-id)
    Logs->>Logs: getInputs() -> compute `topicFilter` (FCLogs:<name> [or FCInstanceEvents:/<name>])
    Logs->>Logs: getSlsQuery(search, qualifier, requestId, instanceId, topicFilter)
    Logs->>SLS: slsClient.getLogs(params (query includes topicFilter), topic removed)
    SLS-->>Logs: returns streaming or history logs
    Logs-->>CLI: display logs
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 A rabbit parses topics in the night,

FCLogs first, then FCInstanceEvents in sight,
Tests and docs nod as filters combine,
Queries take form, precise and fine,
Hooray—logs sing clear, one hop at a time.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main changes: enabling multi-topic search in logs command and implementing SLS field query syntax, which aligns with the primary objectives of this changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/logs-multi-topic-and-query-syntax

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

- Search FCInstanceEvents topic alongside FCLogs when --instance-id is specified
- Use SLS field-specific query syntax: qualifier: "value", instanceID: "value", requestId: "value"
- Stop unsetting LATEST qualifier (was preventing LATEST version log searches)
- Support --request-id and --instance-id filters in realtime (--tail) mode
- Update docs and help text for the new behavior

Change-Id: Id05f45be1e1597dd89682a2ebab336b68735ca89
Co-developed-by: Claude <noreply@anthropic.com>
Change-Id: I2e55f6cfb2ac1a741f26bf8db8f959eb5570c637
Co-developed-by: Claude <noreply@anthropic.com>
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
src/subCommands/logs/index.ts (1)

14-27: 💤 Low value

topic field is now dead code across IGetLogs and IRealtime

IGetLogs.topic (line 19) is never set by any caller in the new code (realtime, _realtimeOnce, and history all build IGetLogs without a topic field), making delete slsParams.topic in getLogs an always-no-op. Similarly, IRealtime.topic (line 26) is still required in the interface and still set by getInputs() (line 189), but none of the methods that accept IRealtime (realtime, _realtimeOnce, history) destructure or consume it.

♻️ Suggested cleanup
 interface IGetLogs {
   projectName: string;
   logStoreName: string;
   from: string | number;
   to: string | number;
-  topic?: string;
   query: string;
 }

 interface IRealtime {
   projectName: string;
   logStoreName: string;
-  topic: string;
   topicFilter: string;
   ...
 }

And in getLogs:

-    // Topic filtering is handled by __topic__ in query, remove topic from SLS request params
-    const slsParams: any = { ...requestParams };
-    delete slsParams.topic;
+    const slsParams: any = { ...requestParams };

And in getInputs() return value:

-      topic,
       topicFilter,
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/subCommands/logs/index.ts` around lines 14 - 27, The topic property is
dead code: update the IGetLogs and IRealtime interfaces to remove the unused
topic field, stop setting/returning topic in getInputs(), and remove the
unnecessary delete slsParams.topic in getLogs; alternatively, if topic is
intended to be used, wire it through the callers (realtime, _realtimeOnce,
history) and consume it where slsParams is constructed. Locate and change the
symbols IGetLogs, IRealtime, getInputs, getLogs, realtime, _realtimeOnce,
history and the reference to slsParams.topic to keep the interfaces and callers
consistent (either remove topic everywhere or pass and use it end-to-end).
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@src/subCommands/logs/index.ts`:
- Around line 14-27: The topic property is dead code: update the IGetLogs and
IRealtime interfaces to remove the unused topic field, stop setting/returning
topic in getInputs(), and remove the unnecessary delete slsParams.topic in
getLogs; alternatively, if topic is intended to be used, wire it through the
callers (realtime, _realtimeOnce, history) and consume it where slsParams is
constructed. Locate and change the symbols IGetLogs, IRealtime, getInputs,
getLogs, realtime, _realtimeOnce, history and the reference to slsParams.topic
to keep the interfaces and callers consistent (either remove topic everywhere or
pass and use it end-to-end).

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 2e0c3e16-a825-4ce6-abb3-0b2b6d3139b3

📥 Commits

Reviewing files that changed from the base of the PR and between 5252f0f and a698c00.

📒 Files selected for processing (7)
  • CLAUDE.md
  • __tests__/ut/commands/logs_test.ts
  • docs/architecture.md
  • docs/technical-documentation.md
  • src/commands-help/logs.ts
  • src/index.ts
  • src/subCommands/logs/index.ts
✅ Files skipped from review due to trivial changes (5)
  • src/index.ts
  • docs/architecture.md
  • docs/technical-documentation.md
  • CLAUDE.md
  • src/commands-help/logs.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • tests/ut/commands/logs_test.ts

… on macOS runners

setup-java@v1 fails to correctly set JAVA_HOME on newer macOS runners.
Temurin doesn't support Java 8 on macOS, so use zulu distribution instead.
Also upgrade checkout@v2→v4 and setup-node@v2→v4.

Change-Id: Ibb3997e6df9cb3c744a1a35fbd90160b276f80b1
Co-developed-by: Claude <noreply@anthropic.com>
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/ci_with_docker_linux.yaml:
- Line 16: The workflow uses an outdated action version
docker/setup-buildx-action@v2 (referenced in the docker-ci-standard and
docker-ci-custom jobs); update both occurrences to docker/setup-buildx-action@v4
so actionlint no longer flags the runner incompatibility and the workflow
matches the other upgraded Docker actions.
- Line 16: The workflow uses an outdated action tag
"docker/setup-buildx-action@v2"; replace both occurrences of this action string
in the CI workflow with the current stable tag "docker/setup-buildx-action@v4"
(or "v4.0.0") so the job definitions that reference setup-buildx-action use the
v4 release; locate the two occurrences of "docker/setup-buildx-action@v2" in the
file and update them to "docker/setup-buildx-action@v4".
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 285a7a11-a91b-4313-91eb-1e698b9ad87d

📥 Commits

Reviewing files that changed from the base of the PR and between a698c00 and 29a1b40.

📒 Files selected for processing (2)
  • .github/workflows/ci_node16.yaml
  • .github/workflows/ci_with_docker_linux.yaml

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- uses: docker/setup-buildx-action@v2
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Upgrade docker/setup-buildx-action@v2 to @v4 — actionlint reports it as too old.

Actionlint flags this action version as incompatible with the current GitHub Actions runner. The latest version is docker/setup-buildx-action@v4, and this should be applied at both Line 16 (docker-ci-standard) and Line 73 (docker-ci-custom). This PR already upgraded the other action versions — docker/setup-buildx-action should follow suit.

🔧 Proposed fix (apply to both Line 16 and Line 73)
-      - uses: docker/setup-buildx-action@v2
+      - uses: docker/setup-buildx-action@v4
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- uses: docker/setup-buildx-action@v2
- uses: docker/setup-buildx-action@v4
🧰 Tools
🪛 actionlint (1.7.12)

[error] 16-16: the runner of "docker/setup-buildx-action@v2" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/ci_with_docker_linux.yaml at line 16, The workflow uses an
outdated action version docker/setup-buildx-action@v2 (referenced in the
docker-ci-standard and docker-ci-custom jobs); update both occurrences to
docker/setup-buildx-action@v4 so actionlint no longer flags the runner
incompatibility and the workflow matches the other upgraded Docker actions.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🌐 Web query:

What is the latest stable version of docker/setup-buildx-action GitHub Action?

💡 Result:

The latest stable version of the GitHub Action docker/setup-buildx-action is v4.0.0 (published 2026-03-05). [1][2] This is reflected by the repository’s “Latest release” being v4.0.0 and the dedicated release tag for v4.0.0. [1][2] Practical usage (stable pin): uses: docker/setup-buildx-action@v4.0.0 (or @v4 to track the v4 major). [1][2]

Citations:


🏁 Script executed:

cat -n .github/workflows/ci_with_docker_linux.yaml | sed -n '14,18p; 71,75p'

Repository: devsapp/fc3

Length of output: 403


docker/setup-buildx-action@v2 is outdated and should be upgraded to v4.

Actionlint flags this action version as incompatible with the current GitHub Actions runner. The latest stable version is v4.0.0. Update both occurrences at line 16 and line 73 in the docker-ci workflow jobs.

🔧 Proposed fix
-      - uses: docker/setup-buildx-action@v2
+      - uses: docker/setup-buildx-action@v4

Apply the same change at line 73.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- uses: docker/setup-buildx-action@v2
- uses: docker/setup-buildx-action@v4
🧰 Tools
🪛 actionlint (1.7.12)

[error] 16-16: the runner of "docker/setup-buildx-action@v2" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/ci_with_docker_linux.yaml at line 16, The workflow uses an
outdated action tag "docker/setup-buildx-action@v2"; replace both occurrences of
this action string in the CI workflow with the current stable tag
"docker/setup-buildx-action@v4" (or "v4.0.0") so the job definitions that
reference setup-buildx-action use the v4 release; locate the two occurrences of
"docker/setup-buildx-action@v2" in the file and update them to
"docker/setup-buildx-action@v4".

@rsonghuster rsonghuster force-pushed the fix/logs-multi-topic-and-query-syntax branch from 29a1b40 to f634129 Compare May 5, 2026 02:51
@rsonghuster rsonghuster merged commit 2b98125 into master May 5, 2026
8 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant